package com.woniu.microownerserver.util;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.net.URL;

public class HtmlParseUtil {
    //https://search.jd.com/Search?keyword=java
    public static void main(String[] args) throws Exception{
        String url = "https://search.jd.com/Search?keyword=java";
        Document document = Jsoup.parse(new URL(url), 30000);
        //得到大体
        Element elements = document.getElementById("J_goodsList");
        //得到所有的书的整体
        Elements lis = elements.getElementsByTag("li");
        System.out.println(lis);
        //遍历每一本书
        for (Element li : lis) {

        }

    }
}
